CD Menus

by Gordon Sweet

gordon@gsweet.fsnet.co.uk


Home

Text To Speech - Pendl

Novice Puzzles - Terra

Slider Controls - Bradbury

Symmetrical Paint - Nally

Programming Style - Brossman

Progress Simulator - Rahman

CD Menus - Sweet

Media File Search - Sweet

Why Liberty BASIC? - Sweet

Submission Guildlines

Newsletter Help

Index

CD Menus Prevent User Problems

In creating a CD for your LB programs by burning, it is important to remind users of the menu, you cannot write to the CD to store data using a Read only CD drive, such as when using a Database. Problems will also occur in the event of a LB program crashing, on account of its attempt to write to an ERROR.LOG file. However I have never found the latter to cause any damage to the system. Below is a way I have successfully overcome various problems of running a selection of programs using a CD menu, including a few old DOS programs of mine. It can be very impressive to use Clipart as background to the main opening Menu, although I found this temporarily disappears such as when activating Windows Explorer, or Word to read a *.DOC file containing instructions.

cover.bmp File Required

You will see the program needs a suitable BMP file for the background named as cover.bmp. I have refrained from including this, to reduce unnecessary downloading time with this News Letter. Although this demo program will work ok providing the cover.bmp and all the runtime files are in the same directory, needless to say it will abort if you attempt to select any of the programs not present. If you want the CD to autoboot your menu, then you need to create an AUTORUN.INF file in the Root Directory using say Notepad, containing the following, with the name of RUN.EXE or RUN400.EXE renamed to match your cdrun.tkn. If you look at the Autorun.inf file created with other CDs by dragging it onto Notepad, you will notice how they sometimes also activate an ICO file.

[autorun]
open=cdun.exe

Errors With Overlapping Applications

The program is set for the 800 x 600 windows, to accommodate the smaller displays, and ux and uy used to ensure the window is centered for the 1024 x 768 displays. Unfortunately I can find no safe way of avoiding the need to retain the menu on display, while the selected programs are running, even though hidden underneath. Hence the need to warn

"DO NOT ACTIVATE THIS MENU WHILE USING SUBSEQUENT MENUS ARE COVERING IT!" even though this is unlikely to cause any problems.

Launching Program With Buttons

You may not need all the buttons in you have no more than 24 programs to list, unless you prefer to categorize them into sub menus as I have done. The variables tx sets the position across for the sub menu title$, and sel sets the RESTORE point for the relevant DATA. You will notice that rather than attempting to use numerous standard Windows buttons throughout, I prefer to adopt my colourful ones. In order to assist others to install whichever of the programs they wish on their Hard drives, I adopted the practice of placing the majority in separate directories with their own run Runtime Engine files etc, as below. Note cdrun.exe also has its own Runtime files in the Root directory.

To make the program compatible with LB version 3.03 I took the liberty of making renaming a copy of RUN400.EXE with version 4 to RUN.EXE, this is needed to activate EXE programs. In the DATA listings, you will see I found it unwise to insert anything such as C:\ before the directory.

CD Space Allows for Graphic and Multimedia Files

In view of the large space available with a blank CD, I suggest you follow my practice of including say some Clipart, MIDi, and MP3 files etc, especially if some programs can use them. But beware of copyrights if attempting to sell CDs containing Music etc.

README.DOC File Recommended

I would also suggest including a README.DOC file to try cover yourself against any possible damage to the user's system, by referring to that supplied with other software. This could also contain instructions and a list of files etc, and you should also warn users of the following:-

BEWARE files copied from a CD will always have all their attributes set to READ ONLY. This should not prevent programs from working unless you wish to change any of the data such as that supplied with DBs or teaching aids. In which case you need to change the Attributes under Properties of at least the data files.

Gordon Sweet



    'CD MENU  - **  YOU MUST  SELECT  a BMP
    ' background to choice named as COVER.BMP

    nomainwin
[start]
    ux = 120 : uy = 90
    if DisplayWidth < 1000 then ux = 1 : uy = 1
    UpperLeftX = ux : UpperLeftY = uy
    WindowWidth = 800 : WindowHeight = 580
    button #cd, " Various Games  ", [games], ll, 30, 50
    button #cd, " Home Accounts  ", [home], ll, 180, 50
    button #cd, " Music Graphics ", [music], ll, 330, 50
    button #cd, " Learning Aids  ", [learn], ll, 480, 50
    button #cd, " Explore the CD ", [see], ll, 630, 50
    button #cd, " Please Read Me ", [help], ll, 180, 20
    button #cd, " *** QUIT *** ", [quit], ll, 480, 20
    open "CD MENU OF SECTIONS - Please Select " for graphics_nf_nsb as #cd
    #cd "trapclose [quit]; discard; font arial 24; fill 100 40 10"
    loadbmp "landscape", "cover.bmp" ' RENAME ANY SUITABLE BMP TO cover.bmp
    #cd "background landscape; drawsprites"
    #cd "backcolor darkgreen; color white; down; place 60 100"
    #cd "\  MENU OF 50 PLUS WINDOWS PROGRAMS "
    #cd "font arial 12 bold; color YELLOW"
    #cd "\DO NOT ACTIVATE THIS MENU WHILE USING SUBSEQUENT MENUS ARE COVERING IT!"
    dim prog$(100,2) : cd = 1
    #cd "backcolor 100 40 10; flush"
[sels] playwave "ping.wav" : wait

[help]
    run$ = "write.exe README.DOC"
    run run$, showmaximized
    wait

[games]
    sel = 1
    choice = 18 : title$ = "\ Menu of Various Games "
    tx = 230 : goto [cmenu]

[home]
    sel = 2
    choice = 16 : title$ = "\ Menu of Programs for Hobbies and Home "
    tx = 100 : goto [cmenu]

[music]
    sel = 3
    choice = 14 : title$ = "\ Menu of Music and Graphics Programs "
    tx = 120 : goto [cmenu]

[learn]
    sel = 4
    choice = 10 : title$ = "\ Menu of Programs to help with Learning "
    tx = 100 : goto [cmenu]

[see]
    run$ = "explorer.exe \"
    run run$, showmaximized
    wait

[cmenu]
    if cd = 1 then close #cd
    cd = 2
    button #m, " MAIN MENU ", [menu1], ll, 340, 50
    open "Menu of Programs - Click on a Button" for graphics_nsb as #m
[pick]
    #m "trapclose [quit]; discard; when leftButtonDown [which]; down"
    #m "font Ariel 24 bold; fill 100 40 10"
    #m "backcolor darkblue; color green; place ";tx;" 50"
    #m title$ : #m "font arial 10 bold"
    #m "color yellow; backcolor 100 40 10; place 80 80"
    #m "\Left Click Selection ONCE ONLY, DO NOT ACTIVATE THIS MENU if subsequent menus are covering it!"

    SELECT CASE sel
        CASE 1
        restore [gamedat]
        CASE 2
        restore [homedat]
        CASE 3
        restore [musicdat]
        CASE 4
        restore [learndat]
    END SELECT

    for n = 1 to choice
        read a$, b$ 
        prog$(n,1) = a$ : prog$(n,2) = b$
    next n
[show]
    #m "font fixedsys; backcolor darkblue; color yellow"
    last = int(choice / 2) : y = 100 : C = 1
    for row = 1 to last
        x = 80
        for colm = 1 to 2
            #m "place ";x;" ";y
            #m "boxfilled ";x+200;" ";y+20
            #m "place ";x+10;" ";y+14
            #m "\";prog$(C,1)
            C = C + 1
            x=x+400
        next colm
        x = 1
        y = y + 30
    next row
    ymax = y - 10
[hold] #m "flush" : beep : wait

[menu1] close #m : goto [start]

[which]
    x=MouseX : y=MouseY
    if x < 80 or x > 680 then [hold]
    if X > 280 and x < 480 then [hold]
    if y < 100 or y > ymax then [hold]
    upper = 100 : lower = 120  : row = 0
    for dat = 1 to last
        if y > upper and y < lower then row = dat
        upper = upper + 30 : lower = lower + 30
    next dat
    row = row * 2
    if x < 400 then row = row - 1
    if row < 1 then [hold]
    cf$ = prog$(row,2)
    if ((instr(cf$,"Emails") > 0) or (instr(cf$,"winas3") > 0)) then
        notice "DO NOT ATTEMPT TO ALTER DATA UNLESS INSTALLED ON HARD DISK"
    end if
    if instr(cf$,"DOS") = 0 then cf$ = "run.exe " + cf$
    run cf$, restore
    goto [pick]

[quit]
    if cd = 1 then close #cd else close #m
    end

[gamedat]
    data "Spacecraft or Aircraft","Attack\attack.tkn"
    data " Windows Bingo Caller ","BingoCall\wbingo.tkn"
    data "Bingo-Lotteries & Race","DOSprogs\vchance.exe"
    data "Choice of 2 Bomb Runs ","Bomber\bomber.tkn"
    data "American Civil War/Map","CivilWar\CwarLB.tkn"
    data "5 Text Graphics Games ","DOSprogs\Textgame.exe"
    data " Multitrack Horserace ","Horserace\Bestrace.tkn"
    data "Random & True Anagrams","SmallGames\Anagrams.tkn"
    data " Simple Driving Tests ","SmallGames\driveLB.tkn"
    data "Hangman - Choose Tests","SmallGames\hangman.tkn"
    data " Musical Demo of Life ","SmallGames\Life1.tkn"
    data "23 Matches and Bantnum","SmallGames\Matches.tkn"
    data "   Colourfull Mazes   ","SmallGames\maze.tkn"
    data "    Mystery Number    ","SmallGames\Mystnumber.tkn"
    data "  Hunt the Submarine  ","SubHunt\SubHunt.tkn"
    data "  Multi Tank Battle   ","TankBattle\tanks.tkn"
    data "Chase & Avoid Zombies ","Zombies\zombies.tkn"
    data "Large Clock Print Sign","Bigshow\Bigshow.tkn"


[homedat]
    data "Adder & Bank Reconcile","ADDERS\wofitol3.tkn"
    data "Small Auction Database","AUCTIONDB\winas3.tkn"
    data "Calendar & Day of Week","CALENDAR\wcalendr4.tkn"
    data "Random Colours & RGBs ","COLOURS\pixels.tkn"
    data " HP deskjet DOS fonts ","DOSprogs\Hpdeskj.exe"
    data "Epson Print DOS fonts ","DOSprogs\Epsontp.exe"
    data "Windows Shell to Dos ","DOSprogs\Doshell.exe"
    data "Fast Internet Address","EMAILSITES\Emails.tkn"
    data " Full PC File Search ","FILESEARCH\Wtxtread3.tkn"
    data "Amateur Radio Logbook","HAMLOG\log.tkn"
    data " Amateur Radio Aids  ","HAMCALCS\HAMhlp.tkn"
    data " True Costs of Loans ","LOANCOST\loans.tkn"
    data "Long Filenames Lists ","LONGNAME\wlongnme4.tkn"
    data "  Mailing Database   ","MAILERDB\wmaildb.tkn"
    data "Personal Phone Lists ","PHONELIST\wphondr4.tkn"
    data "WP/Text file Coverter","TXTCONVERT\wconvert.tkn"

[musicdat]
    data "Play all MID/MP3/WAVs","JUKEBOX\Jukebox.tkn"
    data "  Music Mouse Keys   ","KEYBOARD\Keyboard.tkn"
    data "  Musical Keyboard   ","KEYPIANO\KeyPiano2.tkn"
    data "  Record Scratcher   ","DJSCRATCH\DJscratch.tkn"
    data "Key Precision Drawing","KEYSCAD\wkeyscad.tkn"
    data "  Cycloid Patterns    ","CYCLOIDS\Cycloids.tkn"
    data "   Lorenz Patterns   ","LORENZ\Lorenz.tkn"
    data " Mandelbrot Patterns ","MANDELBROT\Mandlb.tkn"
    data "   Julia Patterns    ","Julias\JuliaLB.TKN"
    data "Multivoice Morse Code","MORSETEST\wmorsets3.tkn"
    data "Clipart Views & Music","PICSHOW\Picshow.tkn"
    data "    Clipart Editor   ","Image323\Image323m.tkn"
    data " Patterns with Music ","PATRNMUSIC\PatrnMusic.tkn"
    data "All Music/Video Files","MUSICVID\MusicVidplayr.tkn"
    data " Choice of Patterns  ","PATTERNS\patterns.tkn"
    data "Generate Random Music","RANDMUSIC\ranmusic.tkn"

[learndat]
    data " Arthmetic Training   ","ARITHMETIC\warithma3.tkn"
    data "  60 Day Biorhythms   ","BIORHYM\Biorhms.tkn"
    data "Net. Downloading Times","DLOADS\dloads.tkn"
    data " Fonts List & Samples ","ALLFONTS\AllfontsAll.tkn"
    data "Speech for Disabled   ","SPEECHAID\wspeech2.tkn"
    data "Speech - Keys/TXT file","TALKER\wtalker2.tkn"
    data "Trigonometrical Graphs","TRIGRAPH\trigraph.tkn"
    data " Typing Trainer/Tests ","TYPINGTEST\wordtst3.tkn"
    data "Cardio-Pulmonary Resus","CPR\CPRupdate.tkn"
    data "Blood Pressure Trainer","BloodP\BldPressTut.tkn"
    end


Home

Text To Speech - Pendl

Novice Puzzles - Terra

Slider Controls - Bradbury

Symmetrical Paint - Nally

Programming Style - Brossman

Progress Simulator - Rahman

CD Menus - Sweet

Media File Search - Sweet

Why Liberty BASIC? - Sweet

Submission Guildlines

Newsletter Help

Index